﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Raven.Client.Embedded;
using MapMaker.Engine.Model.VXAce;
using Raven.Client;

namespace MapMaker.Engine.Core
{
    class RavenDatabase : IDatabase
    {
        private EmbeddableDocumentStore DocumentStore { get; set; }

        public RavenDatabase(string name)
        {
            DocumentStore = new EmbeddableDocumentStore
            {
                DataDirectory = System.IO.Path.Combine("Data", name)
            };
            DocumentStore.Initialize();
        }

        public IResource<Models.Actor> Actor { get { return new RavenResource<Models.Actor>(DocumentStore); } }
        public IResource<Models.Animation> Animation { get { return new RavenResource<Models.Animation>(DocumentStore); } }
        public IResource<Models.Armor> Armor { get { return new RavenResource<Models.Armor>(DocumentStore); } }
        public IResource<Models.BackgroundMusic> BackgroundMusic { get { return new RavenResource<Models.BackgroundMusic>(DocumentStore); } }
        public IResource<Models.BackgroundSound> BackgroundSound { get { return new RavenResource<Models.BackgroundSound>(DocumentStore); } }
        public IResource<Models.Class> Class { get { return new RavenResource<Models.Class>(DocumentStore); } }
        public IResource<Models.CommonEvent> CommonEvent { get { return new RavenResource<Models.CommonEvent>(DocumentStore); } }
        public IResource<Models.Enemy> Enemy { get { return new RavenResource<Models.Enemy>(DocumentStore); } }
        public IResource<Models.EquipableItem> EquipableItem { get { return new RavenResource<Models.EquipableItem>(DocumentStore); } }
        public IResource<Models.Event> Event { get { return new RavenResource<Models.Event>(DocumentStore); } }
        public IResource<Models.Item> Item { get { return new RavenResource<Models.Item>(DocumentStore); } }
        public IResource<Models.MusicalEffect> MusicalEffect { get { return new RavenResource<Models.MusicalEffect>(DocumentStore); } }
        public IResource<Models.SoundEffect> SoundEffect { get { return new RavenResource<Models.SoundEffect>(DocumentStore); } }
        public IResource<Models.Skill> Skill { get { return new RavenResource<Models.Skill>(DocumentStore); } }
        public IResource<Models.State> State { get { return new RavenResource<Models.State>(DocumentStore); } }
        public IResource<Models.Tileset> Tileset { get { return new RavenResource<Models.Tileset>(DocumentStore); } }
        public IResource<Models.Map> Map { get { return new RavenResource<Models.Map>(DocumentStore); } }
        public IResource<Models.Troop> Troop { get { return new RavenResource<Models.Troop>(DocumentStore); } }
        public IResource<Models.UsableItem> UsableItem { get { return new RavenResource<Models.UsableItem>(DocumentStore); } }
        public IResource<Models.Weapon> Weapon { get { return new RavenResource<Models.Weapon>(DocumentStore); } }
    }
}